<!--乙供物资明细列表-->
<template>
    <view class="body" style="width: 100%;padding:60rpx 30rpx 30rpx;overflow: auto;position: relative;min-height: 100%;background-color: #f7f8fa" ref="supplyMaterialDetail">
        <view v-for="(item,index) in dataList" :key="index" style="background-color: #FFFFFF;margin-bottom: 30rpx;padding: 20rpx;border-radius: 15rpx">
            <view style="font-size: 32rpx">明细物料编码：{{item.detailMaterialCode}}</view>
            <view style="line-height: 1.5;font-size: 32rpx">明细物料名称：{{item.detailMaterialName}}</view>
            <view style="display: flex;justify-content: space-between;">
                <view style="font-size: 32rpx">数量：{{item.sumDetailNum}}</view>
                <view style="font-size: 32rpx">占比：{{item.sumDetailProportion}}%</view>
                <view style="font-size: 32rpx">金额：{{item.sumDetailMoney}}</view>
            </view>
            <view style="border: 2rpx solid #dbdbdb;margin-top: 20rpx" v-if="item.labelCodes&&item.labelCodes.length>0">
                <view style="display: flex;text-align: center">
                    <view style="border-right: 2rpx solid #dbdbdb;flex: 1;font-size: 32rpx">资源资产编码</view>
                    <view style="flex: 1;font-size: 32rpx">标签ID</view>
                </view>
                <view v-for="(v,i) in item.labelCodes" :key="i" style="display: flex;border-top:2rpx solid #ddd;text-align: center">
                    <view style="border-right: 2rpx solid #ddd;flex: 1;font-size: 32rpx">{{v.resourceAssetCode}}</view>
                    <view style="flex: 1;color: #4D88FF;font-size: 32rpx" @click="jumpLabel(v.resourceAssetCode,v.labelId)">{{v.labelId}}</view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    components: {
    },
    props:{

    },
    data() {
        return {
            dataList:[]
        }
    },
    onLoad(option) {
        this.dataList = JSON.parse(decodeURIComponent(option.item))
    },
    onShow() {
        // this.$nextTick(()=>{
        //     setTimeout(()=>{
        //         console.log('跳转之后发送高度',this.$refs.supplyMaterialDetail.$el.clientHeight)
        //         window.parent.postMessage({ height: this.$refs.supplyMaterialDetail.$el.clientHeight, type: 'acceptanceHeight' }, '*')
        //     },800)
        // })
    },
    methods:{
        // 跳转至经分系统
        jumpLabel(resourceAssetCode,labelId){
            this.$axios.get('/material/api/pub/material/getOtherSysIpAndPort',{ sysCode:'jingFenSysIpAndPort'}).then((res)=>{
                imp.iWindow.open({url:`${res.data}/api/user/getRedirectToBcsystem?resourceAssetCode=${resourceAssetCode}&elabelNum=${labelId}`})
            })
        },
    }
}
</script>

<style>@import "@/common/common-ui.css";</style>
<style>@import "@/common/uView.css";</style>
<style scoped lang="scss">

</style>